package com.bmps.springcloud.insuredmicroservice.model.cloudplatform;

/**
 * 险类枚举
 * @author llz
 * @date 2019/09/26
 */
public enum SubPermission {

    A("HCT007", 1),

    B("HCT008", 1),

    C("HCT010", 1),

    D("HCT011", 1),

    E("HCT013", 1),

    F("HCT014", 1),

    G("HCT015", 1),

    H("HCT016", 1),

    I("HCT017", 1),

    J("HCT018", 1),

    K("HCT019", 1),

    L("HCT020", 1),

    M("HCT021", 1),

    N("HCT022", 1),

    O("HDT041", 1),

    P("HDT042", 1),

    Q("HDT043", 1),

    R("HDT044", 1),

    S("HDT045", 1),

    T("HDT046", 1),

    U("HDT051", 1),

    V("HDT053", 1),

    W("HDT054", 1),

    X("HMT007", 2),

    Y("HMT008", 2),

    Z("HMT009", 2),

    AA("HMT028", 2),

    AB("HMT029", 2),

    AC("HMT038", 1),

    AD("HMT039", 1),

    AE("HMT044", 1),

    AF("HMT045", 1),

    AG("HMT049", 1),

    AH("HMT050", 1),

    AI("HMT051", 1),

    AL("LBT033", 1),

    AN("LLT020", 3),

    AO("LLT022", 3),

    AP("LWP005", 3),

    AQ("LWT002", 3),

    AR("LWT004", 1),

    AS("LLT025",3);

    /**
     * 对应险类
     */
    private int permissionType;

    /**
     * 险种号
     */
    private String prodCode;

    private SubPermission(String prodCode, int permissionType){
        this.prodCode = prodCode;
        this.permissionType = permissionType;
    }

    public int getPermissionType() {
        return permissionType;
    }

    public void setPermissionType(int permissionType) {
        this.permissionType = permissionType;
    }

    public String getProdCode() {
        return prodCode;
    }

    public void setProdCode(String prodCode) {
        this.prodCode = prodCode;
    }

    public static int getPermissionTypeByProdCode(String prodCode){
        int i = 0 ;
        SubPermission[] all = values();
        for(SubPermission sub : all){
            if(sub.getProdCode().equals(prodCode)){
                return sub.getPermissionType();
            }
        }
        return i;
    }

}
